package com.itye.deom1;




import com.itye.deom1.until.Constant;
import com.itye.deom1.view.MainFrame;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;

public class Application {
    public static void main(String[] args) {
        try {
            for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                System.out.println(info.getName());
                if ("Nimbus".equals(info.getName())) {
                    UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        // 初始化测试数据
        initTestData();
        
        MainFrame mainFrame = new MainFrame();
    }

    private static void initTestData() {
        Student student1 = new Student("张三", 202301);
        Student student2 = new Student("李四", 202302);
        Student student3 = new Student("王五", 202303);
        Student student4 = new Student("赵六", 202304);
        Student student5 = new Student("孙七", 202305);
        Student student6 = new Student("周八", 202306);

        Group group1 = new Group(01);
        group1.addStudent(student1);
        group1.addStudent(student2);
        group1.addStudent(student3);

        Group group2 = new Group(02);
        group2.addStudent(student4);
        group2.addStudent(student5);
        group2.addStudent(student6);

        List<Student> groupStudents1 = new ArrayList<>();
        groupStudents1.add(student1);
        groupStudents1.add(student2);
        groupStudents1.add(student3);
        
        List<Student> groupStudents2 = new ArrayList<>();
        groupStudents2.add(student4);
        groupStudents2.add(student5);
        groupStudents2.add(student6);

        // 添加到Constant中的静态集合
        Constant.groups.put(group1, groupStudents1);
        Constant.groups.put(group2, groupStudents2);
        
        Constant.students.add(student1);
        Constant.students.add(student2);
        Constant.students.add(student3);
        Constant.students.add(student4);
        Constant.students.add(student5);
        Constant.students.add(student6);
    }
}